//
//  UIView+Tools.m
//  ZT_iOS
//
//  Created by Mac on 2020/8/20.
//  Copyright © 2020 Brigitte. All rights reserved.
//

#import "UIView+Tools.h"

@implementation UIView (Tools)


//通过view获取控制器
- (UIViewController *)findViewController:(UIView *)sourceView
{
    id target=sourceView;
    while (target) {
        target = ((UIResponder *)target).nextResponder;
        if ([target isKindOfClass:[UIViewController class]]) {
            break;
        }
    }
    return target;
}
@end
